package com.zf.springdoc.openapi3.controller.v2;

import com.zf.springdoc.openapi3.entity.Student;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.enums.ParameterStyle;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Zhou Feng
 */
@RestController
@RequestMapping("/v2/user")
@Tag(name = "用户 API")
public class UserController {

    @Operation(summary = "测试")
    @GetMapping("/test/{*name}")
    @Parameter(name = "name", description = "名字", in = ParameterIn.PATH, style = ParameterStyle.SIMPLE)
    public Student test(@PathVariable("name") String name) {
        Student student = new Student();
        student.setName(name);
        return student;
    }
}
